//
//  TZWBottomView.swift
//  Sinaweibotzw
//
//  Created by 檀志文 on 16/4/15.
//  Copyright © 2016年 ios檀志文. All rights reserved.
//

import UIKit

class TZWBottomView: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        prepareUI()
    }

    private func prepareUI(){
//        1 添加子控件
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(likeButton)
        
        retweetButton.snp_makeConstraints { (make) -> Void in
         make.leading.top.bottom.equalTo(self)
        }
        
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(retweetButton.snp_trailing)
            make.top.bottom.equalTo(self)
            make.width.equalTo(retweetButton)
        }
        
        likeButton.snp_makeConstraints { (make) -> Void in
            make.top.trailing.bottom.equalTo(self)
            make.leading.equalTo(commentButton.snp_trailing)
            make.width.equalTo(retweetButton)
        }

    }
//  MARK: 懒加载
    
    /// 转发按钮
    private lazy var retweetButton: UIButton = UIButton (image: "timeline_icon_retweet", title: "转发")
    /// 评论按钮
    private lazy var commentButton: UIButton = UIButton(image: "timeline_icon_comment", title: "评论")
    /// 赞
    private lazy var likeButton: UIButton = UIButton(image: "timeline_icon_unlike", title: "赞")
    
    /// 分割线1
    private lazy var separatorViewFirst: UIImageView = UIImageView(imageNamed: "timeline_card_bottom_line")
    
    /// 分割线2
    private lazy var separatorViewSecond: UIImageView = UIImageView(imageNamed: "timeline_card_bottom_line")
}
